<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="https://cdn.staticfile.org/jquery/1.10.2/jquery.min.js">
    </script>
</head>
<body>
<div id="demo">

</div>
<script>
    $(function(){
        alert(1)
        $.get("./ajax_info.txt",function(data,status){
            debugger
            document.getElementById("demo").innerHTML=data;
        });
    });
    // var xhr = new XMLHttpRequest();
    //
    // xhr.onload = function () {
    //     // 输出接收到的文字数据
    //     document.getElementById("demo").innerHTML=xhr.responseText;
    // }
    //
    // xhr.onerror = function () {
    //     document.getElementById("demo").innerHTML="请求出错";
    // }
    //
    // // 发送异步 GET 请求
    // xhr.open("GET", "./ajax_info.txt", true);
    // xhr.send();
</script>
</body>
</html>